﻿//-----------------------------------------------------------------------
// <copyright file="IIdentityEntity.cs" company="CodePlex">
//     Copyright (c) Doug Holland, CodePlex. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CodePlex.Diagnostics.Model
{
    using System;

    using CodePlex.Diagnostics.Contracts;

    /// <summary>
    /// Represents the <see cref="T:System.Security.Principal.IIdentity"/> associated with an exception or log entry.
    /// </summary>
    public sealed partial class IIdentityEntity
    {
        #region public IIdentityEntity()

        /// <summary>
        /// Initializes a new instance of the <see cref="T:IIdentityEntity"/> class.
        /// </summary>
        public IIdentityEntity()
        {
        }

        #endregion

        #region public IIdentityEntity(IIdentityDataContract identity)

        /// <summary>
        /// Initializes a new instance of the <see cref="T:IIdentityEntity"/> class.
        /// </summary>
        /// <param name="identity">An instance of the <see cref="T:IIdentityDataContract"/> class to be used to construct an instance of the <see cref="T:IIdentityEntity"/> class.</param>
        public IIdentityEntity(IIdentityDataContract identity)
        {
            this.Name = identity.Name;

            this.IsAuthenticated = identity.IsAuthenticated;

            this.AuthenticationType = identity.AuthenticationType;

            this.SerializedIIdentityXml = identity.SerializedIIdentity;
        }

        #endregion
    }
}
